<%@ page language="java" import="java.util.*,com.bean.*,com.dao.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	String cardno = request.getParameter("cardno");

	TradeDao dao = new TradeDao();
    List<TradeBean> list = dao.getList(cardno);
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>交易记录查询</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    银行卡交易记录<hr/>
	<form action="bank/record.jsp" method="post">
	
		<select name="cardno" style="width:170px;"/>
		<%
			TradeDao daos = new TradeDao();
			List<TradeBean> cardnos = daos.selectAll();
			for(TradeBean bean : cardnos){
	    	out.println("<option value='"+bean.getCardno()+"'>"+bean.getCardno()+"</option>");
	    	}
		%>
		<option>请选择卡号</option>
		
		<input type="submit" value="查询"/>
		
	</form>
	<table  width="100%" cellpadding="15px" cellspacing="0px" border="1px" style="border-collapse:collapse" bordercolor="#CCCCCC">
		<tr>
			<td width="40%">
				卡号
			</td>
			<td>
				交易时间
			</td>
			<td>
				交易类型
			</td>
			<td>
				交易金额
			</td>
		</tr>
		<%
			//List<TradeBean> trades = dao.selectAll();
			for(TradeBean bean : list){
				out.println("<tr>");
		      	out.println("<td>"+bean.getCardno()+"</td>");
		      	out.println("<td>"+bean.getType()+"</td>");
		      	out.println("<td>"+bean.getMoney()+"</td>");
		      	out.println("<td>"+bean.getTdate()+"</td>");
		      	out.println("</tr>");
			}
		 %>
	</table>
  </body>
</html>
